<!DOCTYPE html>
<html>
<head>
    <title>会员管理</title>
	<#include "/header.html">
    <script src="${request.contextPath}/statics/libs/ajaxupload.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
                <input type="text" class="form-control" style="display: inline; width: 19%;" v-model="q.studentCode" @keyup.enter="query" placeholder="编号">
                <input type="text" class="form-control" style="display: inline; width: 19%;" v-model="q.name" @keyup.enter="query" placeholder="姓名">
                <select class="form-control" style="display: inline; width: 13%;" v-model="q.sex">
                    <option></option>
                    <option value="1">男</option>
                    <option value="0">女</option>
                </select>
                <select class="form-control" style="display: inline; width: 13%;" v-model="q.type">
                    <option></option>
                    <option value="1">一类人员</option>
                    <option value="2">二类人员</option>
                    <option value="3">三类人员</option>
                </select>

            <a class="btn btn-default" @click="query">查询</a>
            <br/>
            <div style="padding-top: 7px">
                <#if shiro.hasPermission("member:member:save")>
                <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
                </#if>
                <#if shiro.hasPermission("member:member:update")>
                <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
                </#if>
                <#if shiro.hasPermission("member:member:update")>
                <a class="btn btn-primary" @click="downloadExTemp"><i class="fa fa-plus"></i>&nbsp;下载人员模板</a>
                </#if>
                <#if shiro.hasPermission("member:member:update")>
                <a class="btn btn-primary" id="upload"><i class="fa fa-plus"></i>&nbsp;上传人员</a>
                </#if>
                <#if shiro.hasPermission("member:member:download")>
                <a class="btn btn-primary" @click="downloadEx"><i class="fa fa-plus"></i>&nbsp;下载人员Excel</a>
                <a class="btn btn-primary" @click="downloadTxt"><i class="fa fa-plus"></i>&nbsp;下载人员Txt</a>
                </#if>
                <#if shiro.hasPermission("member:member:delete")>
                <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
                </#if>
            </div>
            <br/>
            <div style="padding-top: 7px">
                <input style="display: inline-block; width: 300px; position: relative; top: 2px" type="text" class="form-control" id = "comId" placeholder="COM口">
                <a class="btn btn-primary" style="display: inline-block; margin-left: 20px" onclick="openRfid();"><i class="fa fa-plus"></i>&nbsp;打开读卡器</a>
                <a class="btn btn-primary" style="display: inline-block;  margin-left: 20px" onclick="closeRfid();"><i class="fa fa-plus"></i>&nbsp;关闭读卡器</a>
            </div>

        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">

                    <div class="form-group">
                        <div class="col-sm-2 control-label">编号</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="member.studentCode" placeholder="编号"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">姓名</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="member.name" placeholder="姓名"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">性别</div>
                        <div class="col-sm-10">
                            <select class="form-control" v-model="member.sex">
                                <option value="1" selected = "selected">男</option>
                                <option value="0">女</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">出生日期</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="birthdayId" v-model="member.birthday" placeholder="生日" readonly="true"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">人员类别</div>
                        <div class="col-sm-10">
                            <select class="form-control" v-model="member.type">
                                <option value="1">一类人员</option>
                                <option value="2">二类人员</option>
                                <option value="3">三类人员</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">IC编码</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="icCodeId"  v-model="member.icCode" placeholder="IC编码"/>
                            <button id="epcButton" type="button" onclick="findEpc();">获取手环编码</button>
                        </div>
                    </div>

							            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/member/member.js?_${.now?long}"></script>
</body>
</html>